package cn.czh0123.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("user")
public class User extends BasicDomain {
    @NotBlank(message = "用户名不能为空")
    private String username;
    @JSONField(serialize = false)
    @NotBlank(message = "密码不能为空")
    private String passwordHash;
    private String email;
    private String avatar;
    private Date registrationDate;
    private Date lastLoginTime;
    @TableField(exist = false)
    private String saToken;
}